# displayNameHandler

Tries to find the name of a react component. It considers these as possible
names and will use the first one found in order:

- The static property `displayName` in Class components
- Assignment of the static property `displayName` on Class or Function
  components
- The name of a Function or Class component
- The variable name that an anonymous Function Component is assigned to

## Examples

When the `displayNameHandler` is active any of these components will result in
the output below

```ts {2} filename="component.tsx"
export default class extends React.Component {
  static displayName = 'DisplayName';
  render() {
    return <div />;
  }
}
```

```ts {7} filename="component.tsx"
class MyComponent extends React.Component {
  render() {
    return <div />;
  }
}

MyComponent.displayName = 'DisplayName';
```

```ts {5} filename="component.tsx"
function MyComponent() {
  return <div />;
}

MyComponent.displayName = 'DisplayName';
```

```ts {1} filename="component.tsx"
class DisplayName extends React.Component {
  render() {
    return <div />;
  }
}
```

```ts {1} filename="component.tsx"
function DisplayName() {
  return <div />;
}
```

```ts {1} filename="component.tsx"
const DisplayName = () => <div />;
```

## Output

```json {3} filename="JSON"
[
  {
    "displayName": "DisplayName"
  }
]
```
